package com.example.controller;

import com.example.result.CommonResult;
import com.example.service.ReportService;
import com.example.vo.ReportVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject："smart-property"
 * @BelongsPackage："com.example.controller"
 * @CreateTime："2022-11-15 13:42"
 * @Description：举报
 * @Author：LK
 */
@RestController
@RequestMapping("/reportController")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * @description:举报全查
     * @author: lk
     * @date: 2022/11/15 19:52
     * @param: reportVO
     * @return: java.util.List<com.example.dto.ReportDTO>
     **/
    @PostMapping("/reportCheck")
    public CommonResult reportCheck(@RequestBody ReportVO reportVO){
        return reportService.reportCheck(reportVO);
    }

    /**
     * @description:举报审核-不通过
     * @author: lk
     * @date: 2022/11/15 19:55
     * @param: reportNumber
     * @return: com.example.result.CommonResult
     **/
    @PostMapping("/examineReport/{reportNumber}")
    public CommonResult examineReport(@PathVariable String reportNumber){
        return reportService.examineReport(reportNumber);
    }

    /**
     * @description:举报审核-通过
     * @author: lk
     * @date: 2022/11/15 19:55
     * @param: reportNumber
     * @return: com.example.result.CommonResult
     **/
    @PostMapping("/examineAdopt/{reportNumber}")
    public CommonResult examineReport2(@PathVariable String reportNumber){
        return reportService.examineReport2(reportNumber);
    }

    /**
     * @description:删除举报
     * @author: lk
     * @date: 2022/11/15 21:27
     * @param: reportNumber
     * @return: com.example.result.CommonResult
     **/
    @PostMapping("/deleteReport/{reportNumber}")
    public CommonResult deleteReport(@PathVariable String reportNumber){
        return reportService.deleteReport(reportNumber);
    }
}
